package com.example.haojiutao.service.impl;

import com.example.haojiutao.common.Result;
import com.example.haojiutao.mapper.AddressMapper;
import com.example.haojiutao.model.domain.Address;
import com.example.haojiutao.service.AddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: 地址
 * @Author: cheng_jianzhen
 * @CreateTime: 2024/1/29 19:10
 */
@Service
@Slf4j
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;


    /*
     * @Description: 添加地址信息
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/29 19:32
     * @param: address
     * @return: int
     **/

    @Override
    public int insertAddress(Address address) {
        return addressMapper.insertAddress(address);
}
    /*
     * @Description: 修改地址信息
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/29 19:49
     * @param: address
     * @return: int
     **/
    @Override
    public int updateAddress(Address address) {
        return addressMapper.updateAddress(address);
    }

    /*
     * @Description: 删除地址信息
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/29 19:59
     * @param: address
     * @return: int
     **/
    @Override
    public int deleteAddress(Integer addId) {

        return addressMapper.deleteAddress(addId);
    }
    /*
     * @Description: 根据id查询地址信息
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/29 20:13
     * @param: address
     * @return: int
     **/
    @Override
    public Address selectById(Integer id) {
        return addressMapper.selectById(id);
    }
    /*
     * @Description: 查询全部信息
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/29 20:26
     * @param: address
     * @return: int
     **/
    @Override
    public List<Address> selectList(Address address) {
        return addressMapper.selectList(address);
    }
}
